import service from '../request';

const controller = "UserProcedure"

function add(data:Array<any>){
    return service({
        method:'post',
        url:controller,
        data:{procedures:data}
    })
}

function update(id:number,data:any):any{
    return service({
        method:'put',
        url:controller,
        params:{id},
        data
    });
}

function accept(id:number){
    return service({
        method:'put',
        url:controller+'/accept',
        params:{id}
    })
}

function reject(id:number){
    return service({
        method:'put',
        url:controller+'/reject',
        params:{id}
    });
}

function query(data:any):any{
    return service({
        method:'get',
        url:controller,
        data
    })
}
function get(Id:number):any{
    return service({
        method:'get',
        url:controller+`/${Id}`,
    })
}

function getMy(data:any):any{
    return service({
        method:'get',
        url:controller + '/getMy',
        data
    })
}

function getByProject(projectId:number):any{
    return service({
       method:'get',
       url:controller+"/getByProject",
       params:{projectId}
    });
}


export default{
    add,
    update,
    reject,
    query,
    getMy,
    getByProject,
    accept,
	get
}